import {Injectable} from "@angular/core";
import {AppHttp} from "../util/http";
import {interfaceUrls} from "./serverUrls";
@Injectable()
export class StorageService {

    constructor(private http: AppHttp) {

    }

    //出库单_列表查询
    outList(param, pageNo, pageSize) {
        return this.http.post(`${interfaceUrls.outList}?pageNo=${pageNo}&pageSize=${pageSize}`, param);
    }

    //出库单_撤销
    revoke(param) {
        return this.http.post(interfaceUrls.revoke, param);
    }

    //新建出库单
    add(param) {
        return this.http.post(interfaceUrls.add, param);
    }

    //出库单_删除一箱扫码
    delscandetails(param) {
        return this.http.post(interfaceUrls.delscandetails, param);
    }

    //出库单_出库扫码
    scan(param) {
        return this.http.post(interfaceUrls.scan, param);
    }

    //收货记录_抽检扫码
    samplingscan(param) {
        return this.http.post(interfaceUrls.samplingscan, param);
    }

    //出库单_确认删除
    delscan(param) {
        return this.http.post(interfaceUrls.delscan, param);
    }

    //出库单_完成出库
    complete(param) {
        return this.http.post(interfaceUrls.complete, param);
    }

    //收货记录_列表查询
    receivedList(param, pageNo, pageSize) {
        return this.http.post(`${interfaceUrls.receivedList}?pageNo=${pageNo}&pageSize=${pageSize}`, param);
    }

    //获取当前经销商库存大于0的产品列表
    productLists(): Promise<any> {
        return this.http.post(interfaceUrls.productList, {});
    }

    //发货渠道查询(根据产品)
    issuelist(param) {
        return this.http.post(interfaceUrls.issuelist, param);
    }

    //收货渠道查询(根据产品)
    receivelist(param) {
        return this.http.post(interfaceUrls.receivelist, param);
    }
}